﻿@model LTM.School.Core.Models.Course

@{
    ViewData["Title"] = "添加课程";
}

<h2>添加</h2>

<h4>课程信息</h4>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Create">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="CourseId" class="control-label"></label>
                <input asp-for="CourseId" class="form-control" />
                <span asp-validation-for="CourseId" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Title" class="control-label"></label>
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Credits" class="control-label"></label>
                <input asp-for="Credits" class="form-control" />
                <span asp-validation-for="Credits" class="text-danger"></span>
            </div>
            
            <div class="form-group">
                <label asp-for="Department" class="control-label"></label>
                <select asp-for="DepartmentId" class="form-control" asp-items="ViewBag.DepartmentID">
                    <option value="">-- 选择部门 --</option>
                </select>
                <span asp-validation-for="DepartmentId" class="text-danger" ></span>
            </div>
            <div class="form-group">
                <input type="submit" value="添加" class="btn btn-default" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">返回列表</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
